Chris Pollett >
Old Classses > |
HW#5 --- last modified February 06 2019 04:18:19..Due date: May 13
Files to be submitted: Purpose: To learn about default reasoning. To understand the computations a probabilistic agent might do. To gain experience with learning algorithms. Related Course Outcomes: The main course outcomes covered by this assignment are: LO11 -- Students should be able to describe default reasoning. LO12 -- Students should be able to describe or implement at least one learning algorithm. Specification: This homework will consist of the questions below, whose answers should be in Hw5.pdf in your submitted Hw5.zip folder, as well as, the coding exercise beneath them.
For the coding portion of the homework I'd like you to code the perceptron learning algorithm discussed in class and use it to learn the concept of mostly X's versus mostly O's grid of squares. Here we imagine inputs will be a 3x3 grid of squares each square being filled with either an X or O. Your program will be run from the command line with a line like: python xo_learner.py training_file_name.txt test_file_name.txttraining_file_name.txt is the name of a file containing the training set for the algorithm, test_file_name.txt is the name of a file containing a grid which we want to classify as mostly X'd or mostly O'd. Your program on such an input can output whatever diagnostic messages you deem useful, however, the last line it outputs should be either the single word MOSTLY X's (if the grid) or MOSTLY O's (if its not connected). It should produce this output by first training a perceptron using training_file_name.txt and then using the trained perceptron to figure out what should be the output based on the input grid in test_file_name.txt. The file format for the training set is as follows is a sequence of 3x3 grids, followed by a classification line, followed by a blank line. The classification line contains either an X (meaning the example was mostly X's) or an O (meaning mostly O's). As example, a file might contain: XXO OXO OOO O XXX XXX XX0 X OXO OOO XOO O The file test_file_name.txt consists of just a single grid of X's and O's. For example, OOO OXX OOOAs part of your project you should conduct some experiments by randomly generating training sets of different sizes and experimentally determining successful classification percentages for each of these sizes. Write up these experiments in the file Experiments.pdf which you also include with your project. Point Breakdown
|